package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.BywTiktokTicket;
import com.ruoyi.system.mapper.BywTiktokTicketMapper;
import com.ruoyi.system.service.IBywTiktokTicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 抖音推送的ticketService业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-29
 */
@Service
public class BywTiktokTicketServiceImpl implements IBywTiktokTicketService 
{
    @Autowired
    private BywTiktokTicketMapper bywTiktokTicketMapper;

    /**
     * 查询抖音推送的ticket
     * 
     * @param id 抖音推送的ticket主键
     * @return 抖音推送的ticket
     */
    @Override
    public BywTiktokTicket selectBywTiktokTicketById(Long id)
    {
        return bywTiktokTicketMapper.selectBywTiktokTicketById(id);
    }

    /**
     * 查询抖音推送的ticket列表
     * 
     * @param bywTiktokTicket 抖音推送的ticket
     * @return 抖音推送的ticket
     */
    @Override
    public List<BywTiktokTicket> selectBywTiktokTicketList(BywTiktokTicket bywTiktokTicket)
    {
        return bywTiktokTicketMapper.selectBywTiktokTicketList(bywTiktokTicket);
    }

    /**
     * 新增抖音推送的ticket
     * 
     * @param bywTiktokTicket 抖音推送的ticket
     * @return 结果
     */
    @Override
    public int insertBywTiktokTicket(BywTiktokTicket bywTiktokTicket)
    {
        bywTiktokTicket.setCreateTime(DateUtils.getNowDate());
        return bywTiktokTicketMapper.insertBywTiktokTicket(bywTiktokTicket);
    }

    /**
     * 修改抖音推送的ticket
     * 
     * @param bywTiktokTicket 抖音推送的ticket
     * @return 结果
     */
    @Override
    public int updateBywTiktokTicket(BywTiktokTicket bywTiktokTicket)
    {
        bywTiktokTicket.setUpdateTime(DateUtils.getNowDate());
        return bywTiktokTicketMapper.updateBywTiktokTicket(bywTiktokTicket);
    }

    /**
     * 批量删除抖音推送的ticket
     * 
     * @param ids 需要删除的抖音推送的ticket主键
     * @return 结果
     */
    @Override
    public int deleteBywTiktokTicketByIds(Long[] ids)
    {
        return bywTiktokTicketMapper.deleteBywTiktokTicketByIds(ids);
    }

    /**
     * 删除抖音推送的ticket信息
     * 
     * @param id 抖音推送的ticket主键
     * @return 结果
     */
    @Override
    public int deleteBywTiktokTicketById(Long id)
    {
        return bywTiktokTicketMapper.deleteBywTiktokTicketById(id);
    }

    @Override
    public void updateBywTiktokTicketByValue(String ticket) {
        bywTiktokTicketMapper.updateBywTiktokTicketByValue(ticket);
    }
}
